{extend name='main'}

{block name="button"}

{if auth("add")}
<button data-modal='{:url("add")}' data-title="添加学员" class='layui-btn layui-btn-sm layui-btn-primary'>添加学员</button>
{/if}

{if auth("batchadd")}
<button data-open='{:url("batchadd")}' data-title="" class='layui-btn layui-btn-sm layui-btn-primary'>批量添加</button>
{/if}

{if auth("remove")}
<button data-action='{:url("remove")}' data-confirm="确定要删除选定学员吗？"   data-csrf="{:systoken('remove')}" data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除学员</button>
{/if}

{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='member/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='text-left nowrap'>UID</th>
            <th class='text-left nowrap'>用户信息</th>
            <th class='text-left nowrap'>班级</th>
            <th class='text-left nowrap'>用户状态</th>
            <th class='text-left nowrap'>联系手机</th>
            <th class='text-left nowrap'>电子邮箱</th>
            <th class='text-left nowrap'>创建时间</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
            </td>
            <td class="text-left nowrap">
                <span class="font-w7">{$vo.id|default='-'}</span>
            </td>
            <td class='text-left nowrap relative layui-elip'>
                <img src="{$vo.headimg|default=''}" onerror="$(this).remove()" data-tips-image class="inline-block" style="width:40px;height:40px;vertical-align:top;margin-right:5px">
                <div class="inline-block">
                    考生姓名: {$vo.real_name|default='-'}<br>
                    考生学号: {$vo.class_no|default='-'}<br>
                    <!-- 昵称：{$vo.nickname|default='--'}<br> -->
                    <!-- OpenID: {$vo.openid|default='-'} -->
                </div>
            </td>
            <td class='text-left nowrap'>
                {$vo.class_name|default='-'}
            </td>
            <td class='text-left nowrap'>{eq name='vo.status' value='0'}<span class="color-red">冻结</span>{else}<span class="color-green">正常</span>{/eq}</td>
            <td class='text-left nowrap'>
                {$vo.phone|default='-'}
            </td>
            <td class='text-left nowrap'>
                {$vo.mail|default='-'}
            </td>
            <td class='text-left nowrap'>
                {$vo.create_at|format_datetime}
            </td>
            <td class='text-left nowrap'>
                {if auth("edit")}
                <a class="layui-btn layui-btn-sm" data-title="编辑用户" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}

                {if $vo.status eq 1 and auth("forbid")}
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0" data-csrf="{:systoken('forbid')}">冻 结</a>
                {elseif $vo.status eq 0 and auth("resume")}
                <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1" data-csrf="{:systoken('resume')}">启 用</a>
                {/if}

                {if auth("remove")}
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该会员吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
        {/notempty}
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>

{/block}
